
import java.io.IOException;
import java.io.OutputStream;
import javax.microedition.io.Connector;
import javax.microedition.io.file.FileConnection;

public class Arquivo {

  public void salvarArquivo() {
    try {
      FileConnection fc = (FileConnection) Connector.open("Card/log.txt", Connector.READ_WRITE);
      OutputStream out = fc.openOutputStream();
      String s = new String("Texto do arquivo");
      out.write(s.getBytes());

      fc.close();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
}
